import request from "@/axios"

export function transferAccount(data) {
    let url = '/api/account/transfer'
    data.Loading = true
    return request.post(url, data)
}

//转账生效的记录
export function record(type,page,limit) {
    if (!limit) {
        limit = 10
    }
    let status = 1
    let url = '/api/account/record'
    let params = {type,page,limit,status}
    return request.get(url,{params})
}

//货款
export function paymenet(page) {
    // if (!limit) {
    //     limit = 10
    // }
    // let status = 1
    let type = null
    // let bus = 2 //货款
    let url = '/api/account/record'
    let limit = 10
    // let params = {page,type,bus,limit}
    let params = {page,type,limit}
    return request.get(url,{params})
}

export function confirm(recordId) {
    let url = '/api/account/payment'
    let data = {recordId}
    data.Loading = true
    return request.post(url,data)
}

//提交充值订单
export function commit(amount) {
    let url = '/api/account/commit'
    let data = {amount}
    data.Loading = true
    return request.post(url,data)
}

export function getMyEarn(bus,page){
    let url=`/api/my/myProfitsInfo?bus=${bus}&page=${page}&limit=${10}`
    return request.get(url)
}

export function deposit(data) {
    let url = 'api/cashApply/apply'
    data.Loading = true
    return request.post(url,data)
}
